package com.innovations.inn.controller;

import com.innovations.common.core.controller.BaseController;
import com.innovations.framework.web.service.TokenService;
import com.innovations.inn.service.IBusinessDemandFilesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 商业需求附件Controller
 *
 * @author dp
 * @date 2024-08-09
 */
@RestController
@RequestMapping("/inn/business/files")
public class BusinessDemandFilesController extends BaseController {
    @Autowired
    private IBusinessDemandFilesService businessDemandFilesService;
    @Autowired
    TokenService tokenService;

///**
// * 查询商业需求附件列表
// */
//@ApiOperation("查询商业需求附件列表")
//@PreAuthorize("@ss.hasPermi('inn:files:list')")
//@GetMapping("/list")
//    public TableDataInfo list(BusinessDemandFiles businessDemandFiles) {
//        startPage();
//        List<BusinessDemandFiles> list = businessDemandFilesService.selectBusinessDemandFilesList(businessDemandFiles);
//        return getDataTable(list);
//    }
//
//    /**
//     * 导出商业需求附件列表
//     */
//    @PreAuthorize("@ss.hasPermi('inn:files:export')")
//    @Log(title = "商业需求附件", businessType = BusinessType.EXPORT)
//    @PostMapping("/export")
//    public void export(HttpServletResponse response, BusinessDemandFiles businessDemandFiles) {
//        List<BusinessDemandFiles> list = businessDemandFilesService.selectBusinessDemandFilesList(businessDemandFiles);
//        ExcelUtil<BusinessDemandFiles> util = new ExcelUtil<BusinessDemandFiles>(BusinessDemandFiles. class);
//        util.exportExcel(response, list, "商业需求附件数据");
//    }
//
//    /**
//     * 获取商业需求附件详细信息
//     */
//    @ApiOperation("获取商业需求附件详细信息")
//    @PreAuthorize("@ss.hasPermi('inn:files:query')")
//    @GetMapping(value = "/{businessDemandFilesId}")
//    public AjaxResult getInfo(@PathVariable("businessDemandFilesId") Long businessDemandFilesId) {
//        return success(businessDemandFilesService.selectBusinessDemandFilesByBusinessDemandFilesId(businessDemandFilesId));
//    }
//
//    /**
//     * 新增商业需求附件
//     */
//    @ApiOperation("新增商业需求附件")
//    @PreAuthorize("@ss.hasPermi('inn:files:add')")
//    @Log(title = "商业需求附件", businessType = BusinessType.INSERT)
//    @PostMapping
//    public AjaxResult add(HttpServletRequest request, @RequestBody BusinessDemandFiles businessDemandFiles) {
//        Long userId = tokenService.getLoginUser(request).getUser().getUserId();
//        businessDemandFilesService.completeData(businessDemandFiles, userId, 1);
//        return toAjax(businessDemandFilesService.insertBusinessDemandFiles(businessDemandFiles));
//    }
//
//    /**
//     * 修改商业需求附件
//     */
//    @ApiOperation("修改商业需求附件")
//    @PreAuthorize("@ss.hasPermi('inn:files:edit')")
//    @Log(title = "商业需求附件", businessType = BusinessType.UPDATE)
//    @PutMapping
//    public AjaxResult edit(HttpServletRequest request, @RequestBody BusinessDemandFiles businessDemandFiles) {
//        Long userId = tokenService.getLoginUser(request).getUser().getUserId();
//        businessDemandFilesService.completeData(businessDemandFiles, userId, 2);
//        return toAjax(businessDemandFilesService.updateBusinessDemandFiles(businessDemandFiles));
//    }
//
//    /**
//     * 删除商业需求附件
//     */
//    @ApiOperation("删除商业需求附件")
//    @PreAuthorize("@ss.hasPermi('inn:files:remove')")
//    @Log(title = "商业需求附件", businessType = BusinessType.DELETE)
//    @DeleteMapping("/{businessDemandFilesIds}")
//    public AjaxResult remove(@PathVariable Long[] businessDemandFilesIds) {
//        return toAjax(businessDemandFilesService.deleteBusinessDemandFilesByBusinessDemandFilesIds(businessDemandFilesIds));
//    }
}
